package com.why.remote;

import com.github.pagehelper.PageInfo;
import com.why.dto.NhDto;
import com.why.pojo.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

public interface EmployeesAccountRemote {

    //分页查询所有用户
    @RequestMapping("/getPage")
    NhDto<PageInfo<EmployeesAccount>> getPage(@RequestParam HashMap<String,Object> map);

    //添加用户
    @RequestMapping("/addEmpAccount")
    NhDto<Boolean> addEmpAccount(@RequestBody EmployeesAccount employeesAccount,
                                 @RequestParam("backName") String backName,
                                 @RequestParam("frontName") String frontName);

    //删除用户
    @RequestMapping("/delEmpAccount")
    NhDto<Boolean> delEmployeesAccount(@RequestParam("id") Integer id);

    //查询用户
    @RequestMapping("/findEmpAccount")
    NhDto<EmployeesAccount> findEmpAccount(@RequestParam("id") Integer id);

    //修改用户
    @RequestMapping("/updateEmpAccount")
    NhDto<Boolean> updateEmpAccount(@RequestBody EmployeesAccount employeesAccount,
                                    @RequestParam("token") String token);

    //查询权限部门角色
    @RequestMapping("/queryAllPosition")
    NhDto<List<RoleData>> queryAllPosition();

    //查询权限功能
    @RequestMapping("/queryFunctionality")
    NhDto<List<RoleData>> queryFunctionality();

    //分页查询所有部门
    @RequestMapping("/queryDepartment")
    NhDto<PageInfo<Department>> queryDepartment(@RequestParam("pageNum")Integer pageNum,
                                                @RequestParam("pageSize")Integer pageSize);

    //登录
    @RequestMapping("/login")
    NhDto<EmployeesAccount> login(@RequestParam("jobNumber") Integer jobNumber,
                                  @RequestParam("password") String password);

    //用户权限判断
    @RequestMapping("/queryFunctionByPostId")
    NhDto<List<Functionality>> queryFunctionByPostId(@RequestBody EmployeesAccount employeesAccount);

    //查询所有角色
    @RequestMapping("/queryPosition")
    NhDto<List<Position>> queryPosition();

    //上传身份证
    @RequestMapping("/uploadingIcCard")
    NhDto<Boolean> uploadingIcCard(@RequestParam("finalName") String finalName,
                                   @RequestParam("id_card_side") String id_card_side,
                                   @RequestParam("id") Integer id);

    //权限分配
    @RequestMapping("/permissionAssignment")
    NhDto<Boolean> permissionAssignment(@RequestParam("post") String post,
                                       @RequestParam("fun") String fun);

    //添加角色
    @RequestMapping("/addPosition")
    NhDto<Boolean> addPosition(@RequestBody Position position);

    //修改角色和部门
    @RequestMapping("/updatePosition")
    NhDto<Boolean> updatePosition(@RequestParam("id")String id,@RequestParam("post")String post);

    //删除角色
    @RequestMapping("/deletePosition")
    NhDto<Boolean> deletePosition(@RequestParam("id") Integer id);

    //添加部门
    @RequestMapping("/addDepartment")
    NhDto<Boolean> addDepartment(@RequestParam("departmentName") String departmentName);

    //删除部门
    @RequestMapping("/deleteDepartment")
    NhDto<Boolean> deleteDepartment(@RequestParam("id") Integer id);

    //修改密码
    @RequestMapping("/updatePwd")
    NhDto<Boolean> updatePwd(@RequestParam("password") String password,@RequestParam("id") Integer id);

    //修改图像
    @RequestMapping("/uploading")
    NhDto<Boolean> updateImg(@RequestBody EmployeesAccount employeesAccount);

}
